
package com.lnb.util;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@JsonInclude(Include.NON_NULL)	//如果该属性为NULL则不参与序列化
public class Result {

	private Integer code;
	private String msg;
	private Object data;
	private Long count;
	
	/**
	 * 状态码和备注
	 * @param code
	 * @param msg
	 */
	public Result(Integer code, String msg) {
		super();
		this.code = code;
		this.msg = msg;
	}
	
	/**
	 * 状态码、备注、结果数据
	 * @param code
	 * @param msg
	 * @param data
	 */
	public Result(Integer code, String msg, Object data) {
		super();
		this.code = code;
		this.msg = msg;
		this.data = data;
	}
	
	
	/**
	 * 封装layui的结果
	 * @param code
	 * @param msg
	 * @param count
	 * @param data
	 */
	public Result(Integer code, String msg, Object data,Long count) {
		super();
		this.code = code;
		this.msg = msg;
		this.data = data;
		this.count = count;
	}
}

